package ch8_8_24;
import java.io.*;
public class ch8_8_24{
	public static void main(String[] args){
		String filePath="./"+args[1];
		try{
			String s;
			String newString="";
			BufferedReader in=new BufferedReader(new FileReader(filePath));
			while((s=in.readLine())!=null)
				newString += s.replace(args[0], "")+"\r\n";
			
			FileOutputStream out=new FileOutputStream(filePath);
			BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(out));
			bw.write(newString);
			bw.flush();
		}
		catch(Exception e){
			System.out.println(e.toString());
		}
	}
}